//
//  ViewController.m
//  CPSecurityTools
//
//  Created by collegepre on 16/7/4.
//  Copyright © 2016年 collegepre. All rights reserved.
//

#import "ViewController.h"
#import "CPSecurityTools.h"

@interface ViewController ()
@property (nonatomic, assign) NSInteger fileLength;
@property (nonatomic, assign) NSInteger currentLength;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *depath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
//    NSString *string = [[NSBundle mainBundle] pathForResource:@"fullTest.avi" ofType:nil];
//    NSString *dcPAth = [depath stringByAppendingPathComponent:@"fullTest.avi"];
    
//    string = [string stringByDeletingLastPathComponent];
 
        [[CPMediaDecryptTool defaultDecryptTool] decryptWithsuperFilePath:depath headerLength:@"42" keyValue:@"111" progress:^(float progress) {
            NSLog(@"解密进度--%0.2f",progress);
        } complition:^(NSError *error) {
            if (error) {
                NSLog(@"解密失败--%@",error);
            }else{
                NSLog(@"解密成功");
            }
        }];
    
    
}


@end
